package no.ntnu.fp.gui;

import javax.swing.JPanel;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.ListSelectionModel;
import javax.swing.JList;
import javax.swing.JTextField;
import javax.swing.JLabel;
import javax.swing.JTextPane;
import javax.swing.JToggleButton;

public class CalendarWindow extends JPanel {
	private JTable table;
	private JTextField txtSk;

	/**
	 * Create the panel.
	 */
	public CalendarWindow() {
		setLayout(null);
		
		JButton btnNyAvtale = new JButton("Ny Avtale");
		btnNyAvtale.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});
		btnNyAvtale.setBounds(10, 11, 89, 23);
		add(btnNyAvtale);
		
		JButton btnLoggUt = new JButton("Logg ut");
		btnLoggUt.setBounds(614, 0, 73, 23);
		add(btnLoggUt);
		
		table = new JTable();
		table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
		table.setSurrendersFocusOnKeystroke(true);
		table.setFillsViewportHeight(true);
		table.setModel(new DefaultTableModel(
			new Object[][] {
				{"", null, null, null, null, null, null},
				{null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null},
				{null, "", null, null, null, null, null},
				{null, null, null, null, null, null, null},
				{null, "", null, null, null, null, null},
				{null, "", null, null, null, null, null},
				{null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null},
			},
			new String[] {
				"Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "L\u00F8rdag", "S\u00F8ndag"
			}
		));
		table.setCellSelectionEnabled(true);
		table.setColumnSelectionAllowed(true);
		table.setBounds(130, 163, 406, 317);
		add(table);
		
		JList list = new JList();
		list.setBounds(548, 161, 129, 317);
		add(list);
		
		txtSk = new JTextField();
		txtSk.setText("Søk");
		txtSk.setBounds(548, 132, 129, 22);
		add(txtSk);
		txtSk.setColumns(10);
		
		JLabel lblAnsatte = new JLabel("Ansatte");
		lblAnsatte.setBounds(548, 105, 129, 16);
		add(lblAnsatte);
		
		JLabel lblBjarnes = new JLabel("Bjarne Ås");
		lblBjarnes.setBounds(624, 30, 63, 16);
		add(lblBjarnes);
		
		JTextPane txtpnNesteAvtale = new JTextPane();
		txtpnNesteAvtale.setEditable(false);
		txtpnNesteAvtale.setText("Neste Avtale");
		txtpnNesteAvtale.setBounds(138, 0, 406, 73);
		add(txtpnNesteAvtale);
		
		JButton btnMned = new JButton("Måned");
		btnMned.setBounds(465, 132, 73, 23);
		add(btnMned);
		
		JButton btnUke = new JButton("Uke");
		btnUke.setBounds(403, 132, 63, 23);
		add(btnUke);

	}
}
